GBML manual / Constants

DISTORT_WAVE

A jelly wave: the sprite gets narrower and wider as you go down it, so both its edges ripple.

Works differently on Game Boy - The Game Boy narrows a picture by moving its two sprite pieces toward each other on the lines the look names, so the middle of the line is covered instead of squeezed; 16 pixels wide at most, one bent picture at a time.

Works differently on Game Boy Color - The Game Boy Color narrows a picture by moving its two sprite pieces toward each other on the lines the look names, so the middle of the line is covered instead of squeezed; 16 pixels wide at most, one bent picture at a time.

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

DISTORT_WAVE: constant

<!-- GENERATED by tools/gbabel_looks.py from its LOOKS registry. Never edit this page: change the registry and re-run it. -->

Description

Names the jelly wave, for sprite_distort. Every row of the sprite is drawn a little narrower than the one before it and then wider again, in a smooth wave 32 rows long, so the sprite wobbles like jelly. Both edges move, towards the middle and away from it. (WARP_WAVE is different: it moves the whole row sideways.)

strength is how much narrower the narrowest row is: 1 is about five sixths of the sprite's width, 2 about three quarters and 3 about two thirds. No row is ever wider than the sprite.

A real capture, four pictures of the same gold plank - straight, then drawn as a jelly at strength 1, strength 2 and strength 3 (its two edges move in and out as you go down it, more each time) - the wave held in the same place each timeA real capture, four pictures of the same gold plank - straight, then drawn as a jelly at strength 1, strength 2 and strength 3 (its two edges move in and out as you go down it, more each time) - the wave held in the same place each time
A real capture, four pictures of the same gold plank - straight, then drawn as a jelly at strength 1, strength 2 and strength 3 (its two edges move in and out as you go down it, more each time) - the wave held in the same place each time

The same picture four times: straight, then strength 1, 2 and 3 from left to right, each one standing still where the pattern had got to. Real pictures from a Game Boy Advance ROM.

speed is how many rows the wave travels down the sprite every frame. 0 holds it still, a negative number sends it up, 0.25 is slow and 1 is quick. The wave belongs to the sprite, so it stays on the sprite when the sprite moves.

A real capture, 16 frames played in a loop - the plank wobbles like jelly, its left and right edges moving in and out as the wave runs down itA real capture, 16 frames played in a loop - the plank wobbles like jelly, its left and right edges moving in and out as the wave runs down it
A real capture, 16 frames played in a loop - the plank wobbles like jelly, its left and right edges moving in and out as the wave runs down it

The pattern moving, sped up: sixteen real pictures four frames apart, played 70 milliseconds each, at strength 3. It is a whole turn of the pattern, so the loop has no seam. This picture is an animated PNG; a viewer that cannot animate shows its first frame.

Example

sprite_distort(DISTORT_WAVE, 2, 0.5);

A sprite that wobbles like jelly. Call it once, for example in the object's Create event - it keeps going by itself until you call sprite_distort(DISTORT_NONE, 0, 0) or the object is destroyed.

See also: sprite_distortDISTORT_NONEWARP_WAVE